// 封装banner轮播图相关的代码
import { getBannerAPI } from '@/apis/home'
import { onMounted, ref } from 'vue'

export function useBanner() {
    const bannerList = ref([])
    // 获取banner
    const getBanner = async () => {
        let res = await getBannerAPI({
            distributionSite: '2'
        })
        console.log(res);
        bannerList.value = res.result
    }
    onMounted(() => {
        getBanner()
    })

    return {
        bannerList
    }
}